import axios from 'axios'
// 配置超时时间
axios.defaults.timeout = 100000
axios.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8'
axios.defaults.withCredentials = true
// 请求拦截
axios.interceptors.request.use(
  function (config) {
    return config
  },
  function (error) {
    // 失败
    return Promise.reject(error)
  }
)
// 响应拦截
axios.interceptors.response.use(
  function (response) {
    return response
  },
  function (error) {
    // 对响应错误做点什么
    return Promise.reject(error)
  }
)
export default axios
